<?
$r = "../";
require_once($r."_engine/c_account.php");
require_once($r."_engine/c_session.php");


$a = new CAccount();
$a->LoadById(@$id);
$a->Activate(@$activation_code);

// Auto login
$a->Update(array(
	"last_login"	=> gmt_time(),
	"current_login"	=> gmt_time(),
));
$g_session->Set($a->id, $a->data["password"], true);

require_once($r."_engine/functions.php");
generate_html_redirect($r."members/dashboard.php");
?>